doctype
html
    head
        title Backbone Route Test
        meta(http-equiv="Content-Type", content="text/html; charset=UTF-8")
        script(src="../../lib/jquery.min.js")
        script(src = "../../lib/underscore.js")
        script(src = "../../lib/backbone.js")
    body
        script(type='text/javascript').
            var tt = function(id){
                return function(){
                    alert("outer fun " + id)
                }
            }
            var AppRoute = Backbone.Router.extend({
                routes:{
                    "alert/:id": "alerts",
                    "alert2/:id": tt(2),
                    "alert3/:id": tt(3)
                },
                alerts: function (id) {
                    alert("inner fun " + id)
                }
            });
            var appRoute = new AppRoute;

            Backbone.history.start();

        a(type="button", href="#alert/sad") change hash
        br
        a(type="button", href="#alert2/sad") change hash